<!-- A beautiful app starts with a beautiful code :) -->

<!-- /dataDIPA/ProsesRevisi -->

<!-- Header -->
<div class="main-window-segment header-segment bottom-padded">
    <div class="container-fluid">
        <div class="row">
            
            <div class="col-lg-10 col-md-6 col-sm-12">
                <h2>I Account APBN <i>Year on Year</i></h2>
            </div>
            
            <div class="col-lg-1 col-md-3 col-sm-12" style="padding-top: 20px;">
                
			<!-- PDF -->
			<?php
			//----------------------------------------------------
			//Development History.Revisi : 0 Kegiatan :1.mencetak hasil filter ke dalam pdf Dibuat oleh : Rifan Abdul Rachman Tanggal dibuat : 18-07-2014  File yang diubah : monitoringUser.php  
			  if (isset($this->d_tgl_awal)) {
				$kdtgl_awal = $this->d_tgl_awal;
            }else{
				$kdtgl_awal ='null';
			} 
			if (isset($this->d_tgl_akhir)) {
				$kdtgl_akhir = $this->d_tgl_akhir;
            }else{
				$kdtgl_akhir ='null';
			}

			?>
			
            <div class="btn-group-sm">
                <button type="button" class="btn btn-default dropdown-toggle fullwidth" data-toggle="dropdown" aria-expanded="false"><span class="glyphicon glyphicon-print"></span>&nbsp; Cetak <span class="caret"></span>
                </button>
                      <ul class="dropdown-menu" role="menu">
                        <li><a href="<?php echo URL; ?>PDF/DataLRAYoY_BAES1_PDF/PDF/<?php echo $kdtgl_awal . "/" . $kdtgl_akhir; ?>">PDF</a></li>
                        <li><a href="<?php echo URL; ?>PDF/DataLRAYoY_BAES1_PDF/XLS/<?php echo $kdtgl_awal . "/" . $kdtgl_akhir; ?>">EXCEL</a></li>
                      </ul>
            </div>
            
			<?php
				//----------------------------------------------------		
						?>
				
            </div>
            <div class="col-lg-1 col-md-3 col-sm-12" style="padding-top: 20px;">
				
               
                    <button type="button" class="btn btn-default fullwidth" data-toggle="modal" data-target="#modal-app-filter"><span class="glyphicon glyphicon-filter"></span> Filter</button-->
               
                
            </div>
            
        </div>
        
        <div class="row top-padded-little">
            
            <div class="col-md-6 col-sm-12">
                <?php
                if (isset($this->d_nama_kppn)) {
                    foreach ($this->d_nama_kppn as $kppn) {
                        echo $kppn->get_nama_user() . " (" . $kppn->get_kd_satker() . ")";
                        $kode_kppn = $kppn->get_kd_satker();
                    }
                }
				/*
				if (isset($this->last_update)) {
                        foreach ($this->last_update as $last_update) {
                            echo "Cutt OFF Data (Waktu Server) :</br> " . $last_update->get_last_update() . " WIB";
                        }
                    }
				*/
				
				//echo session::get('user');
                if (isset($this->d_kd_satker) ) {
                    echo "<br/>Satker : " . $this->d_kd_satker ;
                }
                if (isset($this->d_tgl_awal) && isset($this->d_tgl_akhir)) {
                    echo "<br/>Tanggal : " . $this->d_tgl_awal . " s.d " . $this->d_tgl_akhir . "&nbsp <b><i>(dalam ribuan rupiah)</b></i>";
                }
				else {
				echo "Per Tanggal : " .(date('d-m-Y')) . "&nbsp <b><i>(dalam ribuan rupiah)</b></i>";
				}
                ?>
            </div>
            
            <div class="col-md-6 col-sm-12 align-right">
                <?php
                    //if (isset($this->last_update)) {
                        //foreach ($this->last_update as $last_update) {
                           // echo "Update Data Terakhir (Waktu Server) :</br> " . $last_update->get_last_update() . " WIB";
                        //}
                    //}
                ?>
            </div>
            
        </div>
        
    </div>
</div>

<!--Tabel-->
<div id="table-container" class="wrapper">
    <table width="100%" class="footable">

        <thead>
            
            <tr>
                
                <th rowspan=3 >URAIAN</th>
                <th colspan=3 >2015</th>
                <th colspan=3 >2014</th>
				<th rowspan=3 >INDIKATOR</th>
                
            </tr>
            
			<tr>              
                <th rowspan=2>APBN-P</th>
                <th colspan=2 >REALISASI</th>
				<th rowspan=2>APBN-P</th>
                <th colspan=2>REALISASI</th>
            </tr >
			<tr>
				<th >Jumlah</th>
				<th >%</th>
				<th >Jumlah</th>
				<th >%</th>			
			</tr >
			
			
        </thead>
        
        <tbody>
            
            <?php $no = 1; $total; ?>

            <?php if (isset($this->data)) { ?>
            
                <?php if (empty($this->data)) { ?>
            
                    <td colspan=8 class="align-center">Tidak ada data.</td>
            
                <?php } else { ?>
            
                    <?php 					
					// *fungsion bikin kurung buat negatif
								function format_currency($amount) {
									if($amount < 0)
										return str_replace("-", "","(".$amount.")");

									else return $amount;
								}
								
								
					
					foreach ($this->data as $value) { ?>
					
					<?php if ($value->get_flag() != null) { ?>								
								
                        <tr style="font-weight: bold;">
						
					<?php } else { ?>
					
						<tr>
						
					<?php } ?>
                           
                            <td class="align-left"><pre><?php echo $value->get_deskripsi(); ?></pre></td>
                            <td class="align-right"><?php echo format_currency(number_format(round($value->get_apbn_15() / 1000))); ?></td>
							<td class="align-right"><?php echo format_currency(number_format(round($value->get_jumlah_15() / 1000))); ?></td>							
							<td class="align-center"><?php echo $value->get_persentase_15(); ?></td>			
                            <td class="align-right"><?php echo format_currency(number_format(round($value->get_apbn_14() / 1000))); ?></td>
							<td class="align-right"><?php echo format_currency(number_format(round($value->get_jumlah_14() / 1000))); ?></td>
							<td class="align-center"><?php echo $value->get_persentase_14(); ?></td>	
							<!--td class="align-right"><?php echo $value->get_updownflag(); ?></td-->
                            <?php if ($value->get_updownflag() == 'DOWN') { 
							?>
                            <td class="align-center"><span style="color:red" class="glyphicon glyphicon-circle-arrow-down"></span></td>
							<?php } else { ?>
							<td class="align-center"><span style="color:green" class="glyphicon glyphicon-circle-arrow-up"></span></td>
							<?php } ?>
                            <!--td class="align-center"><?php //if	($value->get_apbn() == 0) { 
							//echo '0.00%';
							//} 
						//else { echo 
						//"(". number_format($value->get_jumlah()/$value->get_apbn()*100,2)."%)";
						//} ; ?></td-->
                        </tr>

                    <?php } ?>
                            
                <?php } ?>
                            
            <?php } else { ?>
                            
                <td colspan=8 class="align-center" id="filter-first">Silahkan masukkan filter terlebih dahulu.</td>
            
            <?php } ?>
            
        </tbody>
        
    </table>
</div>

<div class="modal fade" id="modal-app-filter" tabindex="-1" role="dialog" aria-labelledby="app-filter-label" aria-hidden="true">
        
    <div class="modal-dialog">

        <div class="modal-content">

            <div class="modal-header">

                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Tutup</span></button>
                <h4 class="modal-title" id="app-filter-label"><span class="glyphicon glyphicon-filter"></span> Filter Data</h4>

            </div>
            
            <form id="filter-form" method="POST" action="#" enctype="multipart/form-data">

                <div class="modal-body">
                    
	                <div id="wtgl" class="alert alert-danger" style="display:none;"></div>
                    <label class="isian">Tanggal: </label>
                    
                    <div class="input-daterange input-group" id="datepicker" style="width: 100%">
                        <input class="form-control" type="text" class="tanggal" name="tgl_awal" id="tgl_awal1" value="<?php if (isset($this->d_tgl_awal)){echo $this->d_tgl_awal;}?>">
                        <span class="input-group-addon">s.d.</span>
                        <input class="form-control" type="text" class="tanggal" name="tgl_akhir" id="tgl_akhir1" value="<?php if (isset($this->d_tgl_akhir)){echo $this->d_tgl_akhir;}?>">
                    </div>
                    
                    
                    
                  
                    
                </div>

                <div class="modal-footer">
                    <button type="submit" name="submit_file" class="btn btn-primary fullwidth" onClick="">Kirim</button>
                </div>

            </form>

        </div>

    </div>

</div>

<script type="text/javascript">

    //Skrip validasi di sini

</script>